package edu.ccut.saturn.operation.time;

import java.text.SimpleDateFormat;
import java.util.Date;

import edu.ccut.saturn.component.DefaultComponent;

public class GetSystemTime extends DefaultComponent {
    private static GetSystemTime instance = new GetSystemTime();
    private GetSystemTime(){};
    public static GetSystemTime getInstance(){
       return	instance;
    }
	public String execute() throws Exception {
		return this.getSystemTime();
	}

	private String getSystemTime() {
		Date date = new Date();
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return format.format(date);
	}
}
